<include file="Public/header" />
<title></title>
</head>
<body>
<div class="page-container">
    <form class="form form-horizontal" id="form-article-add">
        <div class="row cl">
            <label class="form-label col-xs-6"><span class="c-red">*</span>是否云仓商品：</label>
            <div class="formControls col-xs-4">
			<input type="hidden" class="input-text" value="<{:I('id')}>"  name="id">
			<input type="hidden" class="input-text" value="<{:I('warehouse_code')}>"  name="warehouse_code">
			<input type="hidden" class="input-text" value="<{:I('grounding_status')}>"  name="grounding_status">
                <select name="cloud_depot_status" data-toggle="<{$detail.cloud_depot_status}>" class="select">
                    <option value="2">请选择</option>
                    <option value="1">是</option>
                    <option value="0">否</option>
                </select>
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-6"><span class="c-red">*</span>云仓商品数量：</label>
            <div class="formControls col-xs-4">
                <input type="text" class="input-text" value="<{$detail.cloud_num}>"  name="cloud_num">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-6"><span class="c-red">*</span>云仓商品单位：</label>
            <div class="formControls col-xs-4">
				<select name="cloud_unit" data-toggle="<{$detail.cloud_unit}>" class="select">
                    <option value="0">请选择</option>
					<foreach name="unit_list" item="vo">
						<option value="<{$vo.unit_no}>"><{$vo.unit_name}></option>
					</foreach>
                </select>
            </div>
        </div>
        <div class="row cl">
            <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
                <button onClick="save()" class="btn btn-secondary radius" type="button"><i class="Hui-iconfont">&#xe632;</i> 保存</button>
                <button onClick="cancel()" class="btn btn-default radius" type="button">&nbsp;&nbsp;取消&nbsp;&nbsp;</button>
            </div>
        </div>
    </form>
</div>
<include file="Public/footer_js" />
<script>
    $("select[name=cloud_unit]").prop('value',$("select[name=cloud_unit]").attr('data-toggle'));
	$("select[name=cloud_depot_status]").prop('value',$("select[name=cloud_depot_status]").attr('data-toggle'));
    function save(){
        $.post('__CONTROLLER__/editD',{
            id:$("input[name=id]").val(),
            warehouse_code:$("input[name=warehouse_code]").val(),
            cloud_num:$("input[name=cloud_num]").val(),
            cloud_depot_status:$("select[name=cloud_depot_status]").val(),
			cloud_unit:$("select[name=cloud_unit]").val(),
        },function (msg){
            layer.msg(msg.data);
            if(msg.flag==1){
                setTimeout(function (){
                    parent.layer.closeAll();
                    parent.location.reload();
                },800);
            }
        },'json');
    }
    function cancel(){
        parent.layer.closeAll();
    }
</script>
</body>
</html>